//商品vuex 数据模块

import { api_goods_categories } from "@/apis/goods";




const state = {
	goodsCategories:[]
};

const getters = {};
//同步方法
const mutations = {
	SET_GOODS_CATE(state,data){
        state.goodsCategories=data
    }
};
// 异步方法
const actions = {
	$_GOODS_CATE({commit}){
        return new Promise(async resolve=>{
        const res = await api_goods_categories()
        // console.log(res);
        commit('SET_GOODS_CATE',res.data)
        resolve()
        }) 
    }

};

export default {
	//命名空间
	namespaced: true,
	state,
	getters,
	mutations,
	actions,
};
